#include "personstats.h"
#include"utils.h"
#include <stdlib.h>

PersonStats::PersonStats()
{
    HP = 1000;
    setResistence(350 + (rand()%50));
    setImmuneStrength(200 + (rand()%100));
    setImmuneResponse(200 + (rand()%100));
    setCleanliness(0);
    gammaglobulins = 0;
}

double PersonStats::getHP()
{
    return HP;
}

void PersonStats::setHP(double value)
{
    HP = Utils::clamp(value, 0.0, 1000.0);
}

int PersonStats::getResistence()
{
    return resistence;
}

void PersonStats::setResistence(int value)
{
    resistence = value;
    resistence = Utils::clamp(resistence,0,1000);
}

int PersonStats::getImmuneStrength()
{
    return immuneStrength;
}

void PersonStats::setImmuneStrength(int value)
{
    immuneStrength = Utils::clamp(value, 0, 1000);
}

int PersonStats::getImmuneResponse()
{
    return immuneResponse;
}

void PersonStats::setImmuneResponse(int value)
{
    immuneResponse = Utils::clamp(value, 0, 1000);
}

int PersonStats::getCleanliness()
{
    return cleanliness;
}

void PersonStats::setCleanliness(int value)
{
    cleanliness = Utils::clamp(value, 0, 200);
}

int PersonStats::getGammaglobulins()
{
    return gammaglobulins;
}


void PersonStats::useGammaglobulins()
{
    gammaTime = 120;
    gammaglobulins = 2000;
}

void PersonStats::itterateGammagloubulins()
{
    if(gammaTime > 0)
        gammaTime -= 0.05;
    else
        gammaglobulins = 0;
}

